/*
 * This file is part of Formin Media Library
 * 
 */
package formin.mediaLibrary.gui.components;

import javax.swing.BoxLayout;
import javax.swing.JPanel;

import formin.mediaLibrary.io.DataBaseManager;
import formin.mediaLibrary.io.FileIO;
import formin.mediaLibrary.model.SettingsData;

/**
 * 
 * 
 * @author formin
 *
 */
public class MainPanel extends JPanel {


	//==========================================================================
    // Static attributes
    //==========================================================================
	/**
	 * The unique serial version identifier.
	 */
	private static final long serialVersionUID = -5723018035541166827L;
	
	
	
	//==========================================================================
    // Attributes
    //==========================================================================
	/*
	 * top panel containing MediaTypePanel and 
	 */
	private final TopPanel topPanel;
	
	/*
	 * details panel that contains the different detail specific panels
	 */
	private final DetailsMainPanel detailsPanel;
	
	private SettingsData settingsData;
	private DataBaseManager dbManager;
    //==========================================================================
    // Constructors
    //==========================================================================

	public MainPanel(){
		settingsData = FileIO.readSettings();
		dbManager = new DataBaseManager(settingsData);
		
		this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
		topPanel = new TopPanel(this);
		detailsPanel = new DetailsMainPanel();
		
		add(topPanel);
		add(detailsPanel);
	}
    //==========================================================================
    // Getters
    //==========================================================================

    //==========================================================================
    // Setters
    //==========================================================================

    //==========================================================================
    // Inherited methods
    //==========================================================================

    //==========================================================================
    // Static methods
    //==========================================================================
	public void setDisplayDetail(String type){
		detailsPanel.setDetailsDisplay(type);
	}
}
